package awesomeTask

import (
	"awesomeTask/config"
	"awesomeTask/system/kernel"
	log2 "awesomeTask/system/log"
)

type pyTask interface {
	RunTask()
}

type pyTaskWorker struct {
	Project  string
	mainFile string
}

func (worker pyTaskWorker) RunTask(args string) {
	projectPath := config.GetConfigByKey("projectPath").(string) + "/" + worker.Project
	interpreter := projectPath + "venv/Scripts/python -u "
	log2.GetLogger().Info("开始运行工作脚本")
	kernel.GetKernelDriver().ExceShellOrBash(interpreter+projectPath+worker.mainFile+" "+args, false)
}
